package my.jieh.tips.swing;
import java.awt.*;
import java.awt.Robot;
import java.io.*;

public class FamousBlueScreen extends Frame implements Runnable {
  GraphicsDevice device;
  FamousBlueScreen(GraphicsDevice device) {
    super(device.getDefaultConfiguration());
    this.device = device;
    this.add(new BluePanel(), BorderLayout.CENTER);
  }
  public void run() {
    try {
      Thread.sleep(5000);
    } catch (Exception ex) {
    } finally {
      device.setFullScreenWindow(null);
      System.exit(0);
    }
  }
  public static void main(String[] args) {
    GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice device = env.getDefaultScreenDevice();
    try {
      GraphicsConfiguration gc = device.getDefaultConfiguration();
      FamousBlueScreen mainFrame = new FamousBlueScreen(device);
      mainFrame.setUndecorated(true);
      mainFrame.setIgnoreRepaint(true);
      device.setFullScreenWindow(mainFrame);
      Thread t = new Thread(mainFrame);
      t.start();
      Robot r = new Robot(device);
      r.mouseMove(1023, 767);
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
    }
  }
}

class BluePanel extends Panel {
  public void paint(Graphics g) {
    g.setColor(Color.blue);
    g.fillRect(0,0, 1023, 767);
  }
}